package com.jinbooks.entity.customer;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jinbooks.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 客户聚合实体类，用于统一处理客户基本信息和扩展信息
 *
 * @author wuyan
 */
@Data
@ToString
@EqualsAndHashCode(callSuper = true)
@TableName("jbx_customer_view")
public class CustomerAggregate extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    // 基本信息字段
    private String id;
    private String phone;
    private String phoneMd5;
    private String identifier;
    private String identifierMd5;
    private String phoneIdentifierMd5;
    private String customerName;
    private String customerType;
    private String industry;
    private String email;
    private String website;
    private String segmentId;
    private String customerHead;
    private String customerFrom;
    private String merchantCode;
    private String merchantName;
    private String workspaceId;
    private String deleted;

    // 扩展信息字段
    // 居住地址相关字段
    private String province;
    private String provinceCode;
    private String city;
    private String cityCode;
    private String district;
    private String districtCode;
    private String address;

    // 个人相关字段
    private String maritalStatus;
    private String education;
    private String housingType;
    private String incomeType;
    private String content;

    // 税务相关字段
    private String taxNumber;
    private String taxContact;
    private String taxBank;
    private String taxBankAccount;
    private String taxBankAccountNumber;
    private LocalDateTime lastPurchaseTime;
    private Integer purchaseFrequency;
    private BigDecimal totalSpending;
    private Integer serviceSatisfaction;

    // 人脸相关字段
    private String faceImage;
    private String faceScore;
    private String faceScoreApi;
    private String faceStatus;
    private String faceMsg;
    private LocalDateTime faceTime;

    // 公司相关字段
    private String companyName;
    private String companyProvince;
    private String companyProvinceCode;
    private String companyCity;
    private String companyCityCode;
    private String companyDistrict;
    private String companyDistrictCode;
    private String companyAddress;
    private String companyTel;
    private String companyNature;
    private String companyIndustry;

    // 证件相关字段
    private String idCardFrontImage;
    private String idCardBackImage;
    private String idCardName;
    private String idCardGender;
    private String idCardNation;
    private LocalDate idCardBirth;
    private String idCardProvince;
    private String idCardProvinceCode;
    private String idCardCity;
    private String idCardCityCode;
    private String idCardDistrict;
    private String idCardDistrictCode;
    private String idCardAddress;
    private String idCardIssueAuthority;
    private LocalDate idCardValidDate;
    private String businessLicenseImage;
    private String businessLicenseName;
    private String businessLicenseCreditCode;
    private String businessLicenseLegalPerson;
    private String businessLicenseRegCapital;
    private LocalDate businessLicenseEstablishDate;
    private String businessLicenseValidPeriod;
    private String businessLicenseProvince;
    private String businessLicenseProvinceCode;
    private String businessLicenseCity;
    private String businessLicenseCityCode;
    private String businessLicenseDistrict;
    private String businessLicenseDistrictCode;
    private String businessLicenseAddress;

    // 注意：createdBy, createdDate, modifiedBy, modifiedDate 字段在 BaseEntity 中已定义
}